<template>
  <div @mouseover="showset" @mouseout="hideset" :style="{color:moddata.config.fontcolor}" class="mod">
    <div>
      <div class="con">
        <div class="title" v-show="moddata.config.titleshow">
          <span>
            <i class="iconfont icon-barrage_fill"></i>&nbsp;{{moddata.config.title}}</span>
        </div>
        <div class="text mymod" v-html="moddata.config.content">
        </div>
      </div>
    </div>
    <div class="mask" v-show="maskshow">
      <div class="settingbtn" @click="headset">
        <i class="el-icon-setting"></i> 设置</div>
      <div class="deletebtn" @click="deletemod">
        <i class="el-icon-delete"></i> 删除</div>
    </div>
  </div>
</template>

<script>
  import {
    MessageBox
  } from 'element-ui'
  export default {
    props: ["moddata", "index"],
    data: function () {
      return {
        maskshow: false
      }
    },
    methods: {
      showset: function () {
        this.maskshow = true;
      },
      hideset: function () {
        this.maskshow = false;
      },
      headset: function () {
        this.$store.commit({
          type: 'showsetbox',
          setMod: 'setmyMod',
          index: this.index
        })
      },
      deletemod: function () {
        this.$store.dispatch('deleteMod', this.index)
      }
    }
  }
</script>

<style scoped lang="less">
  .mod {
    position: relative;
  }
  .text{
    padding:8px;
  }

  .bds_weixin {
    display: inline-block;
    background: url(/Areas/Template/Content/Design/images/bdsharebuttonbox.png) no-repeat;
    background-size: 32px 288px;
    height: 32px;
    font-size: 12px;
    color: #fff;
    width: 58px;
    padding-left: 24px;
    line-height: 32px;
    text-align: center;
    box-sizing: content-box;
    border-radius: 2px;
    float: none;
    background-position: 0 -128px;
    background-color: #5bc333;
  }

  .bds_weixin:hover {
    opacity: .8;
    filter: alpha(opacity=80);
  }

  .sponsor1 {
    .con {
      border: 1px solid #eaeaea;
    }
    .text{
      background:#ffffff;
    }
    .title {
      padding: 0 20px;
      height: 40px;
      font-size: 16px;
      color: #434343;
      background: #f8f8f8;
      line-height: 40px;
      .iconfont {
        display: none;
      }
    }
  }
</style>
<style lang="less">
  .text img {
    max-width: 100%;
  }

  .mymod {
    word-wrap: break-word;
    cursor: text;
    font-family: sans-serif;
    font-size: 16px;
    b,
    strong {
      font-weight: bold;
    }
    i,
    em {
      font-style: italic;
    }
    p {
      margin: 5px 0;
    }
  }
</style>